﻿using System.Text;
using VIA.Extensions;
using VIA.Integration.Domain;
using VIA.Integration.Presentation;
using VIA.Modularity;
using VIA.SiMoJi.Domain;
using VIA.SiMoJi.Presentation;
using VIA.VTPlatformService;

namespace VIA.SiMoJi.Management
{
    [DependsOn(typeof(Autofac.AutofacModule))]
    [DependsOn(typeof(VIA.Integration.EntityFramework.Sqlite.IntegrationEntityFrameworkSqliteModule))]
    [DependsOn(typeof(VIA.RbacPassport.EntityFramework.Migrations.RbacPassportEntityFrameworkSqliteModule))]
    [DependsOn(typeof(VIA.OperatingRecord.EntityFramework.Sqlite.VIAOperatingRecordEntityFrameworkSqliteModule))]
    [DependsOn(typeof(SiMoJiDomainModule))]
    [DependsOn(typeof(SiMoJiPresentationModule))]
    [DependsOn(typeof(VIAVTPlatformServiceModule))]
    public class StartupModule : AbpModule
    {
        public override void ConfigureServices(ServiceConfigurationContext context)
        {
            Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
            Configure<IntegrationPresentationOption>(x => x.AutoShowShellView = false);
            context.Services.UseNLog("NLog.config");
            context.Services.ReplaceWithSingleton<IRecipeComparisonService, RecipeComparisonService_Newtonsoft>();
        }
    }

}
